Field of the Invention
The present invention relates to a numerical controller, and more particularly, to a numerical controller configured to perform retraction control such that no trace is left on a machined surface of a workpiece when machining is interrupted.
Description of the Related Art
In conventional machine tools including five-axis machining machines, machining may sometimes be interrupted due to power failure or replacement of a tool. If the machining is expected to be stopped, a signal that requests the stop is activated manually or automatically. Thereupon, a numerical controller senses the signal and stops servomotors. This signal that requests the servomotors to be stopped is called “stop signal”.
However, the tool is in contact with a workpiece during the machining. If the drive of the motors is simply stopped, the motors stop with the tool and the workpiece in contact with each other, possibly hindering subsequent operations. In general, therefore, control is needed to operate a spindle or the like so as to separate the tool from the workpiece when the machining is interrupted. The operation for separating the tool from the workpiece is called “retraction”.
Japanese Patent Application Laid-Open No. 08-054914 discloses a technique for controlling a motor for tool axis feed to retract a tool to a safe area in case of power failure. In the technique disclosed in this patent document, interruption of machining and retraction are achieved in the following procedures.
<A1> Turning-on of a stop signal is sensed during the machining.
<A2> The tool is decelerated and stopped along an instructed machining path, whereupon the machining is interrupted.
<A3> The tool is retracted by a prescribed tool-direction distance at a position where the machining is interrupted.
The tool is decelerated and stopped along the instructed machining path in Procedure <A2> in order to prevent a workpiece from being deformed due to the interruption.
In a five-axis machining machine, the direction of a tool relative to a workpiece changes during machining, so that the direction of retraction is generally defined as a direction (hereinafter referred to as “tool direction”) from the distal end to the proximal end of the tool along the tool length. If the tool is retracted in any other direction than the tool direction, the tool and the workpiece may interfere with each other and be damaged, depending on the shape of the workpiece.
In the five-axis machining machine, moreover, the tool direction is controlled by two rotary axes, so that it is changed from moment to moment during the machining. Thus, in performing the retraction in the five-axis machining machine, the direction in which the tool or a table is moved depends on the positions of the two rotary axes. In a numerical controller for controlling the five-axis machining machine comprising these two rotary axes, therefore, the retraction is performed in a direction calculated according to the positions of the two rotary axes.
In the above technique disclosed in Japanese Patent Application Laid-Open No. 08-054914, the tool is retracted in the tool direction after it is temporarily decelerated and stopped during the machining, as described in Procedures <A2> and <A3>. Thus, the machining is stopped with the tool and the workpiece in contact with each other. This causes a problem that a trace (cutter mark) is left on a machined surface of the workpiece, thereby reducing the surface quality, as in a prior art retraction operation shown in the schematic diagram of FIG. 6.